package com.soms.server.controller;

import com.soms.server.common.JsonResult;
import jdk.nashorn.internal.parser.Token;
import org.springframework.web.bind.annotation.*;

import java.util.HashMap;
import java.util.Map;

@RestController
@RequestMapping("/user")
@CrossOrigin
public class LoginCrotroller {
    // login登录接口，随便写一下，模拟登陆成功
    @PostMapping("login")
    public JsonResult login(){

        String token = "admin";
        Map map = new HashMap();
        map.put("token","admin");
        return new JsonResult(true,map);
    }

    // info
    @GetMapping("info")
    public JsonResult info(){
        Map map = new HashMap();
        map.put("roles","[admin]");
        map.put("name","admin");
        map.put("avatar","https://guli-file-190513.oss-cn-beijing.aliyuncs.com/avatar/default.jpg");
        return new JsonResult(true,map);
    }
}
